
	#include<stdio.h>
	#include<conio.h>

	struct student {

	int id;
	char name[12];
	int age;

	};

	void main()  {

	int i;

	clrscr();

	student std[3];

	FILE *st;

	st = fopen("st.txt","w");


	fprintf(st,"  \n STUDENT DETAILS \n");
	fprintf(st,"=======================\n");

	fprintf(st,"ID      NAME    AGE\n");
	fprintf(st,"========================\n");


	for(i=0;i<3;i++) {
	printf("ENTER STUDENT ID :\n");
	scanf("%d",&std[i].id);
	printf("ENTER STUDENT NAME :\n");
	scanf("%s",std[i].name);
	printf("ENTER STUDENT AGE :\n");
	scanf("%d",&std[i].age);


	fprintf(st,"\n%d\t %s\t %d\n",std[i].id,std[i].name,std[i].age);
	fprintf(st,"===================\n");

	}

	fclose(st);


	printf("  \n STUDENT DETAILS \n");
	printf("=======================\n");

	printf("ID      NAME    AGE\n");
	printf("========================\n");


	for(i=0;i<3;i++)  {

	printf("\n%d   \t%s  \t%d\n",std[i].id,std[i].name,std[i].age);

	}

	getch();
	}




